package com.childenglish;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;

@SpringBootApplication
public class ChildEnglishApplication {

    @Value("${spring.instance.id:unknown}")
    private String instanceId;

    @Value("${server.port:8080}")
    private String serverPort;

    public static void main(String[] args) {
        SpringApplication.run(ChildEnglishApplication.class, args);
    }

    @PostConstruct
    public void printStartupInfo() {
        System.out.println("==========================================");
        System.out.println("🎓 少儿英语辅助学习平台启动成功！");
        System.out.println("🏠 实例ID: " + instanceId);
        System.out.println("🔗 端口: " + serverPort);
        System.out.println("🌐 访问地址：http://localhost:" + serverPort);
        System.out.println("📊 集群健康检查：http://localhost:" + serverPort + "/cluster/health");
        System.out.println("💾 会话存储：Redis");
        System.out.println("==========================================");
    }
}